package cn.xiaohuodui.rest;

import cn.xiaohuodui.exceptions.BussException;
import cn.xiaohuodui.form.PageForm;
import cn.xiaohuodui.res.JsonRes;
import cn.xiaohuodui.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by TR on 2018/4/2.
 */

@RestController
@RequestMapping("/wx/brand")
public class BrandApi {

    @Autowired
    private BrandService brandService;

    /**
     * 分页获取品牌
     */
    @RequestMapping("list")
    public JsonRes<Map<String,Object>> list(PageForm form) {
        return brandService.list(form);
    }

    /**
     * 品牌详情
     */
    @RequestMapping("detail")
    public JsonRes<Map<String,Object>> detail(Integer id) throws BussException {

        return brandService.detail(id);
    }
}
